package com.example.lotterysystem.service.enums;


import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;

@AllArgsConstructor
@Getter
public enum UserIdentityEnum {
    ADMIN("ADMIN"),
    NORMAL("NORMAL");
    private String identity;

    public static UserIdentityEnum fromIdentity(String identity) {
        for (UserIdentityEnum value : UserIdentityEnum.values()) {
            if (value.identity.equalsIgnoreCase(identity)) {
                return value;
            }
        }
        return null;
    }
}
